package ms.jacrim;

import java.io.FileWriter;
import java.io.IOException;

import javax.xml.parsers.ParserConfigurationException;

import ms.jacrim.pddl.PddlProblemGenerator;
import ms.utils.XmlFile;

import org.xml.sax.SAXException;


public class genPddl {

	/**
	 * @param args
	 * @throws IOException
	 * @throws SAXException
	 * @throws ParserConfigurationException
	 */
	public static void main(String[] args) throws Exception {
		if (args.length != 2) {
			System.out.println("Usage: genPddl <configuration file> <output file>");
			System.exit(0);
		}
		System.setProperty("java.security.policy", "java.policy");
		PddlProblemGenerator gen = new PddlProblemGenerator();
		gen.setConfig(new XmlFile(args[0]));
		
		FileWriter fw = new FileWriter(args[1], false);
		fw.write(gen.generate().toString());
		fw.close();
	}

}
